#include <iostream>
#include <thread>

using namespace std;

static void update(int& i) {
	i *= 2;
}

int main(int argc, char** argv) {
	int k = 3;
	thread t(update, ref(k));
	t.join();
	cout << "k = " << k << endl;  // k = 6
	return 0;
}

